package com.zhj.service.impl;


import com.zhj.config.accesslog.ApiLogAnnotation;
import com.zhj.mapper.DemoMapper;
import com.zhj.mapper.MyUserDetailsServiceMapper;
import com.zhj.po.CmsSubject;
import com.zhj.po.MyUserDetails;
import com.zhj.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Service;

/**
 * Copyright: Copyright (c) 2020 hantu
 *
 * @ClassName: DemoServiceImpl
 * @Description:
 * @version: v1.0.0
 * @author: zhanghaojie
 * @date: 2020/5/6
 */
@Service
public class DemoServiceImpl implements DemoService {
    @Autowired
    private DemoMapper demoMapper;
    @Autowired
    private MyUserDetailsServiceMapper myUserDetailsServiceMapper;
    @Override
    @PreAuthorize("hasRole('admin')")
    public CmsSubject selectOneById(Integer id) {
        long l = System.currentTimeMillis();
        System.out.println(System.currentTimeMillis());
        CmsSubject cmsSubject = demoMapper.selectOneById(id);
       // CmsSubject cmsSubject1 = demoMapper.selectOneById(id);
        /*CmsSubject cmsSubject2 = demoMapper.selectOneById(id);
        CmsSubject cmsSubject3 = demoMapper.selectOneById(id);
        CmsSubject cmsSubject4 = demoMapper.selectOneById(id);
        CmsSubject cmsSubject5 = demoMapper.selectOneById(id);
        CmsSubject cmsSubject6 = demoMapper.selectOneById(id);*/
        MyUserDetails byUserName = myUserDetailsServiceMapper.findByUserName("13350062845");
        System.out.println((System.currentTimeMillis()-l));
        return cmsSubject;
    }
    public void testZhj(Integer id) {
        System.out.println(id);
    }


    @Override
    @ApiLogAnnotation("default")
    public void select(int i) {
        return;
    }
}
